package org.studiox.graph.persistence.mybatis.tk.domain;

import org.studiox.graph.persistence.mybatis.tk.base.BaseGraphDO;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Objects;

@Entity
@Table(name = "graph_edge")
public class GraphEdgeDO extends BaseGraphDO {

  @Column(name = "content")
  private String content;

  @Column(name = "content_md5")
  private String contentMd5;

  @Column(name = "source_vertex_uniq")
  private String sourceVertexUniq;

  @Column(name = "target_vertex_uniq")
  private String targetVertexUniq;

  @Column(name = "janus_edge_id")
  private String janusEdgeId;

  @Column(name = "neo4j_edge_id")
  private Long neo4jEdgeId;

  @Column(name = "nebula_edge_id")
  private String nebulaEdgeId;

  @Column(name = "source_janus_vertex_id")
  private Long sourceJanusVertexId;

  @Column(name = "target_janus_vertex_id")
  private Long targetJanusVertexId;

  @Column(name = "source_neo4j_vertex_id")
  private Long sourceNeo4jVertexId;

  @Column(name = "target_neo4j_vertex_id")
  private Long targetNeo4jVertexId;

  @Column(name = "source_nebula_vertex_id")
  private Long sourceNebulaVertexId;

  @Column(name = "target_nebula_vertex_id")
  private Long targetNebulaVertexId;

  public String getContent() {
    return content;
  }

  public void setContent(String content) {
    this.content = content;
  }

  public String getContentMd5() {
    return contentMd5;
  }

  public void setContentMd5(String contentMd5) {
    this.contentMd5 = contentMd5;
  }

  public String getSourceVertexUniq() {
    return sourceVertexUniq;
  }

  public void setSourceVertexUniq(String sourceVertexUniq) {
    this.sourceVertexUniq = sourceVertexUniq;
  }

  public String getTargetVertexUniq() {
    return targetVertexUniq;
  }

  public void setTargetVertexUniq(String targetVertexUniq) {
    this.targetVertexUniq = targetVertexUniq;
  }

  public String getJanusEdgeId() {
    return janusEdgeId;
  }

  public void setJanusEdgeId(String janusEdgeId) {
    this.janusEdgeId = janusEdgeId;
  }

  public Long getNeo4jEdgeId() {
    return neo4jEdgeId;
  }

  public void setNeo4jEdgeId(Long neo4jEdgeId) {
    this.neo4jEdgeId = neo4jEdgeId;
  }

  public String getNebulaEdgeId() {
    return nebulaEdgeId;
  }

  public void setNebulaEdgeId(String nebulaEdgeId) {
    this.nebulaEdgeId = nebulaEdgeId;
  }

  public Long getSourceJanusVertexId() {
    return sourceJanusVertexId;
  }

  public void setSourceJanusVertexId(Long sourceJanusVertexId) {
    this.sourceJanusVertexId = sourceJanusVertexId;
  }

  public Long getTargetJanusVertexId() {
    return targetJanusVertexId;
  }

  public void setTargetJanusVertexId(Long targetJanusVertexId) {
    this.targetJanusVertexId = targetJanusVertexId;
  }

  public Long getSourceNeo4jVertexId() {
    return sourceNeo4jVertexId;
  }

  public void setSourceNeo4jVertexId(Long sourceNeo4jVertexId) {
    this.sourceNeo4jVertexId = sourceNeo4jVertexId;
  }

  public Long getTargetNeo4jVertexId() {
    return targetNeo4jVertexId;
  }

  public void setTargetNeo4jVertexId(Long targetNeo4jVertexId) {
    this.targetNeo4jVertexId = targetNeo4jVertexId;
  }

  public Long getSourceNebulaVertexId() {
    return sourceNebulaVertexId;
  }

  public void setSourceNebulaVertexId(Long sourceNebulaVertexId) {
    this.sourceNebulaVertexId = sourceNebulaVertexId;
  }

  public Long getTargetNebulaVertexId() {
    return targetNebulaVertexId;
  }

  public void setTargetNebulaVertexId(Long targetNebulaVertexId) {
    this.targetNebulaVertexId = targetNebulaVertexId;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    if (!super.equals(o)) {
      return false;
    }
    GraphEdgeDO that = (GraphEdgeDO) o;
    return Objects.equals(content, that.content)
        && Objects.equals(contentMd5, that.contentMd5)
        && Objects.equals(sourceVertexUniq, that.sourceVertexUniq)
        && Objects.equals(targetVertexUniq, that.targetVertexUniq)
        && Objects.equals(janusEdgeId, that.janusEdgeId)
        && Objects.equals(neo4jEdgeId, that.neo4jEdgeId)
        && Objects.equals(nebulaEdgeId, that.nebulaEdgeId)
        && Objects.equals(sourceJanusVertexId, that.sourceJanusVertexId)
        && Objects.equals(targetJanusVertexId, that.targetJanusVertexId)
        && Objects.equals(sourceNeo4jVertexId, that.sourceNeo4jVertexId)
        && Objects.equals(targetNeo4jVertexId, that.targetNeo4jVertexId)
        && Objects.equals(sourceNebulaVertexId, that.sourceNebulaVertexId)
        && Objects.equals(targetNebulaVertexId, that.targetNebulaVertexId);
  }

  @Override
  public int hashCode() {
    return Objects.hash(
        super.hashCode(),
        content,
        contentMd5,
        sourceVertexUniq,
        targetVertexUniq,
        janusEdgeId,
        neo4jEdgeId,
        nebulaEdgeId,
        sourceJanusVertexId,
        targetJanusVertexId,
        sourceNeo4jVertexId,
        targetNeo4jVertexId,
        sourceNebulaVertexId,
        targetNebulaVertexId);
  }

  @Override
  public String toString() {
    final StringBuffer sb = new StringBuffer("GraphEdgeDO{");
    sb.append("content='").append(content).append('\'');
    sb.append(", contentMd5='").append(contentMd5).append('\'');
    sb.append(", sourceVertexUniq='").append(sourceVertexUniq).append('\'');
    sb.append(", targetVertexUniq='").append(targetVertexUniq).append('\'');
    sb.append(", janusEdgeId='").append(janusEdgeId).append('\'');
    sb.append(", neo4jEdgeId=").append(neo4jEdgeId);
    sb.append(", nebulaEdgeId='").append(nebulaEdgeId).append('\'');
    sb.append(", sourceJanusVertexId=").append(sourceJanusVertexId);
    sb.append(", targetJanusVertexId=").append(targetJanusVertexId);
    sb.append(", sourceNeo4jVertexId=").append(sourceNeo4jVertexId);
    sb.append(", targetNeo4jVertexId=").append(targetNeo4jVertexId);
    sb.append(", sourceNebulaVertexId=").append(sourceNebulaVertexId);
    sb.append(", targetNebulaVertexId=").append(targetNebulaVertexId);
    sb.append('}');
    return sb.toString();
  }
}
